package com.pinda.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.pinda.auth.entity.PdAuthRole;
import com.pinda.auth.search.PdAuthRoleSearch;
import com.pinda.auth.view.AuthorizationView;
import com.pinda.auth.view.ConfigView;
import com.pinda.commonutils.Page;

import java.util.List;

/**
 * <p>
 * 角色 服务类
 * </p>
 *
 * @author 黄杰
 * @since 2023-06-13
 */
public interface IPdAuthRoleService extends IService<PdAuthRole> {
    /**
     * TODO 分页条件查询所有角色
     * @param page
     * @return List<PdAuthRole>
     */
    PageInfo<PdAuthRole> findRoleService(Page<PdAuthRoleSearch> page);


    /**
     * TODO 查询不是自己的用户具有的角色 授权
     * @param roleId
     * @param userId
     * @return
     */
    AuthorizationView findAuthorizationService(String roleId, String userId);

    /**
     * TODO 批量授予或回收用户角色
     * @param authorizationView
     * @return int
     */

    boolean batchAuthorizationService(AuthorizationView authorizationView);

    /**
     * TODO 根据角色id查询具有的菜单和资源
     * @param roleId
     * @return ConfigView
     */
    ConfigView findConfigService(String roleId);

    /**
     * TODO 根据角色id来批量授予或回收角色菜单和角色资源
     * @param configView
     * @return
     */
    boolean batchConfigService(ConfigView configView);

    /**
     * TODO 新增角色
     * @param pdAuthRole
     * @return
     */
    boolean addRoleService(PdAuthRole pdAuthRole);
}
